﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Windows.Data;

namespace Mengsk.ERP.App.Orders
{
    public class OrderStateConverter : IValueConverter
    {
        public object Convert(object value, Type targetType, object parameter, System.Globalization.CultureInfo culture)
        {
            string state = value.ToString();

            if (state == OrderView.OrderViewModel.ORDER_STATE_COD_CANCEL)
            {
                return "货到付款 已取消";
            }

            if (state == OrderView.OrderViewModel.ORDER_STATE_COD_REFUSE)
            {
                return "货到付款 已拒收";
            }

            if (state == OrderView.OrderViewModel.ORDER_STATE_COD_SHIP_OK)
            {
                return "货到付款 已发货";
            }

            if (state == OrderView.OrderViewModel.ORDER_STATE_COD_SIGN)
            {
                return "货到付款 已签收";
            }

            if (state == OrderView.OrderViewModel.ORDER_STATE_COD_SUCESS)
            {
                return "货到付款 已返款";
            }

            if (state == OrderView.OrderViewModel.ORDER_STATE_COD_WAIT_SHIP)
            {
                return "货到付款 待发货";
            }
            return state;
        }

        public object ConvertBack(object value, Type targetType, object parameter, System.Globalization.CultureInfo culture)
        {
            throw new NotImplementedException();
        }
    }
}
